package com.azunitech.jms.ejb.unit;

import static com.google.inject.matcher.Matchers.*;

import java.util.ArrayList;
import java.util.List;
import com.google.inject.AbstractModule;
import com.google.inject.Scopes;

public class ExampleModule extends AbstractModule {

    private List<Object> injectees = new ArrayList<Object>();

    public void configure() {
        bind(UserManager.class).to(UserManagerImpl.class).in(Scopes.SINGLETON);
        RoleValidationInterceptor roleValidationInterceptor = new RoleValidationInterceptor();
        bindInterceptor(
            any(),
            annotatedWith(RequiresRole.class),
            roleValidationInterceptor);
        injectees.add(roleValidationInterceptor);
    }

    public List<Object> getInjectees() {
        return injectees;
    }

}
